// index.js
// 获取应用实例
const app = getApp()

Page({
  data: {
    arr: new Array(5).fill(),
    funIcon: [{
        icon: 'location',
        color: '#Fff'
      },
      {
        icon: 'like',
        color: 'rgb(242,179,88)'
      },
      {
        icon: 'star',
        color: 'rgb(68,192,252)'
      },
      {
        icon: 'phone',
        color: 'rgb(0,209,209)'
      },
      {
        icon: 'setting',
        color: 'rgb(45,139,252)'
      },
    ],
    funMain: [{
        icon: new Array(4).fill('location'),
        color: 'rgb(45,139,252)',
        fun: 'A'
      }, {
        icon: new Array(4).fill('like'),
        color: 'rgb(242,179,88)',
        fun: 'B'
      }, {
        icon: new Array(4).fill('star'),
        color: 'rgb(68,192,252)',
        fun: 'C'
      }, {
        icon: new Array(4).fill('phone'),
        color: 'rgb(0,209,209)',
        fun: 'D'
      }, {
        icon: 'location',
        color: 'rgb(45,139,252)',
        fun: 'E'
      },
      {
        icon: 'like',
        color: 'rgb(242,179,88)',
        fun: 'F'
      },
      {
        icon: 'star',
        color: 'rgb(68,192,252)',
        fun: 'G'
      },
      {
        icon: 'phone',
        color: 'rgb(0,209,209)',
        fun: 'H'
      },
      {
        icon: 'setting',
        color: 'rgb(45,139,252)',
        fun: 'I'
      },
      {
        icon: 'setting',
        color: 'rgb(45,139,252)',
        fun: 'J'
      },

    ],
    active: 0,
    show: false,
    fun:''
  },

  onLoad() {
    console.log(this.data.funMain);
  },
  onChange(event) {
    // event.detail 的值为当前选中项的索引
    this.setData({
      active: event.detail
    });
  },
  showFun(e) {
    if (e.currentTarget.id === '1') {
      console.log(2);
      this.setData({
        show: true,
        fun:e.currentTarget.dataset.fun
      })
    } else {
      return
    }

  },
  getUserInfo(event) {
    console.log(event.detail);
  },

  onClose() {
    this.setData({
      show: false
    });
  },
})